package com.open.capacity.trade.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.open.capacity.common.model.Concurrent;
import com.open.capacity.dto.EditSalaryDto;
import com.open.capacity.trade.vo.ConcurrentVo;
import com.open.capacity.trade.vo.SalaryInfoVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface ConcurrentDao extends BaseMapper<Concurrent> {
    int count(Map<String, Object> params);

    List<ConcurrentVo> findAllConcurrent(Map<String, Object> params);

    @Delete("delete from crm_concurrent where crm_concurrent.id = #{id} and crm_concurrent.concurrent_id=#{concurrentId}")
    void deleteConcurrent(@Param("id") Long id,@Param("concurrentId") Long concurrentId);

    int updateOrEnabled(Concurrent concurrent);

    Integer updateEmployment(Concurrent concurrent);

    int insertConcurrent(Concurrent concurrent);
    @Select("select * from crm_concurrent where crm_concurrent.id=#{id} and crm_concurrent.concurrent_id=#{concurrentId}")
    Concurrent findById(@Param("id") Long id, @Param("concurrentId") Long concurrentId);

    Integer updateConcurrent(Concurrent concurrent);

    SalaryInfoVo findSalaryByBatchId(Long id);

    int editSalaryByBatchId(EditSalaryDto dto);
}
